namespace Pna.InfoSource.Sbb.JsonModels
{
    using System;
    using System.Globalization;

    public class Connection
    {
        public string Date { get; set; }

        public Checkpoint From { get; set; }
        
        public Checkpoint To { get; set; }

        public string Duration { get; set; }

        public TimeSpan DurationTimeSpan
        {
            get
            {
                return TimeSpan.ParseExact(this.Duration, @"dd\dhh\:mm\:ss", CultureInfo.InvariantCulture);
            }
        }

        public string Transfers { get; set; }
        
        public Service Service { get; set; }

        public string[] Products { get; set; }
        
        public string Capacity1st { get; set; }
        
        public string Capacity2nd { get; set; }

        public Section[] Sections { get; set; }
    }
}